package com.tencent.wuyanzu.service.impl;

import java.util.ArrayList;

import org.springframework.beans.factory.annotation.Autowired;

import com.tencent.wuyanzu.dao.UserDao;
import com.tencent.wuyanzu.model.Food;
import com.tencent.wuyanzu.model.User;
import com.tencent.wuyanzu.service.InitService;

public class InitServiceImpl implements InitService{

	final static String PATH_PREFIX  = "http://mini-10054511.file.myqcloud.com/mini/img/food/";
	@Autowired
	private UserDao userDao;
	
	@Override
	public int createUser() {
		User user = new User(0, 0);
		userDao.addUser(user);
		return user.getuID();
	}

	
	@Override
	public ArrayList<Food> provideTestFoods() {
		
		ArrayList<Food> res = new ArrayList<Food>();
		for(int i = 0 ; i < 9 ; i++){
			res.add(new Food(i, "", PATH_PREFIX+i+".jpg", "", "", 0, 0,null));
		}
		return res;
	}
}
